package com.dingwen.treasure.model.entity.mybatisplus;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 页面元素表
 *
 * @author dingwen
 * @TableName sys_element
 * @date 2022/06/20
 */
@TableName(value = "sys_element")
@ApiModel(value = "sysElement", description = "页面元素表")
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
@Data
public class SysElement extends BaseEntity implements Serializable {
    /**
     * 主键
     */
    @ApiModelProperty(value = "主键")
    @TableId(value = "element_id", type = IdType.AUTO)
    private Integer elementId;

    /**
     * 元素名称
     */
    @ApiModelProperty(value = "元素名称")
    @TableField(value = "element_name")
    private String elementName;

    /**
     * 元素类型(1: 按钮)
     */
    @ApiModelProperty(value = "元素类型(1: 按钮)")
    @TableField(value = "element_type")
    private Integer elementType;

    /**
     * 权限
     */
    @ApiModelProperty(value = "权限")
    @TableField(value = "perms")
    private String perms;

    /**
     * 菜单ID
     */
    @ApiModelProperty(value = "菜单ID")
    @TableField(value = "menu_id")
    private Long menuId;


    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Builder(toBuilder = true)

    public SysElement(LocalDateTime createTime, LocalDateTime updateTime, Integer deleted, Integer version, String createBy, String updateBy, String remark, Integer elementId, String elementName, Integer elementType, String perms, Long menuId) {
        super(createTime, updateTime, deleted, version, createBy, updateBy, remark);
        this.elementId = elementId;
        this.elementName = elementName;
        this.elementType = elementType;
        this.perms = perms;
        this.menuId = menuId;
    }
}